// typeinfo standard header for gcc/EDG
#ifndef _TYPEINFO_
#define _TYPEINFO_
#include <exception>

 #if _HAS_CPP0X
 #include <string.h>	// for type_info::hash_code()
 #endif /* _HAS_CPP0X */

 #if defined(__BORLANDC__) && !__EDG__
  #include <typeinfo.h>

 #else /* defined(__BORLANDC__) && !__EDG__ */
namespace std {
		// CLASS bad_cast
class bad_cast
	: public _XSTD exception
	{	// base of all bad-cast exceptions
public:
	bad_cast() _THROW0()
		{	// construct with no message string
		}

 #if defined(__MINGW32__)
	virtual ~bad_cast() _NOEXCEPT;
 #endif /* defined(__MINGW32__) */

 #if 4 <= __GNUC__ && 4 <= __GNUC_MINOR__

 #else /* 4 <= __GNUC__ etc. */
	virtual const char *what() const _THROW0()
		{	// report a bad cast
		return ("bad cast");
		}
 #endif /* 4 <= __GNUC__ etc. */

 #if _HAS_EXCEPTIONS

 #else /* _HAS_EXCEPTIONS */

protected:
	virtual void _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */
	};

		// CLASS bad_typeid
class bad_typeid
	: public _XSTD exception
	{	// base of all bad-typeid exceptions
public:
	bad_typeid() _THROW0()
		{	// construct with no message string
		}

 #if defined(__MINGW32__)
	virtual ~bad_typeid() _NOEXCEPT;
 #endif /* defined(__MINGW32__) */

 #if 4 <= __GNUC__ && 4 <= __GNUC_MINOR__

 #else /* 4 <= __GNUC__ etc. */
	virtual const char *what() const _THROW0()
		{	// report a bad typeid
		return ("bad typeid");
		}
 #endif /* 4 <= __GNUC__ etc. */

 #if _HAS_EXCEPTIONS

 #else /* _HAS_EXCEPTIONS */

protected:
	virtual void _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
 #endif /* _HAS_EXCEPTIONS */
	};
}	// namespace std

 #if __GNUC__ < 3

 #else /* __GNUC__ < 3 */
namespace __cxxabiv1
	{	// declare forward reference to __class_type_info
	class __class_type_info;
	}
 #endif /* __GNUC__ < 3 */

namespace std {
 #if __EDG__
  #pragma define_type_info
 #endif /* __EDG__ */

		// CLASS type_info
class type_info
	{	// translator-supplied descriptor for a type
public:
 #if _HAS_CPP0X
	size_t hash_code() const _THROW0()
		{	// hash name() to size_t value by pseudorandomizing transform
		return (_STD _Hash_seq((const unsigned char *)name(),
			_CSTD strlen(name())));
		}
 #endif /* _HAS_CPP0X */

	virtual ~type_info() _NOEXCEPT;	// destroy the object

  #if __EDG__ || defined(__SUNPRO_CC)
	bool before(
		const type_info&) const _NOEXCEPT;	// test if this precedes arg

	bool operator==(
		const type_info&) const _NOEXCEPT;	// test for equality

	bool operator!=(
		const type_info&) const _NOEXCEPT;	// test for inequality

	const char *name() const _NOEXCEPT;	// return name of type

  #elif __GNUC__ < 3
	bool before(
		const type_info&) const _NOEXCEPT;	// test if this precedes arg

	bool operator==(
		const type_info&) const _NOEXCEPT;	// test for equality

	bool operator!=(
		const type_info&) const _NOEXCEPT;	// test for inequality

	const char *name() const _NOEXCEPT;	// return name of type

protected:
	explicit type_info(const char *);	// construct with name

	const char *_Myname;

  #else /* GCC V3.0 */

   #if defined(__MINGW32__)
	bool before(
		const type_info&) const _NOEXCEPT;	// test if this precedes arg

	bool operator==(
		const type_info&) const _NOEXCEPT;	// test for equality

   #else /* defined(__MINGW32__) */
	bool before(const type_info& _Right) const _NOEXCEPT
		{	// test if this precedes arg
		return (_Myname < _Right._Myname);
		}

	bool operator==(const type_info& _Right) const _NOEXCEPT
		{	// test for equality
		return (_Myname == _Right._Myname);
		}
   #endif /* defined(__MINGW32__) */

	bool operator!=(const type_info& _Right) const _NOEXCEPT
		{	// test for inequality
		return (!(*this == _Right));
		}

	const char *name() const
		{	// return name of type
		return (_Myname);
		}

 #if !_CLANG
	virtual bool __is_pointer_p() const;
	virtual bool __is_function_p() const;
	virtual bool __do_catch(const type_info *, void **, unsigned) const;
	virtual bool __do_upcast(const __cxxabiv1::__class_type_info *, void **)
		const;
 #endif /* !_CLANG */

 #if _NO_RTTI
#define typeid(x)	(_STD type_info("void"))

 #else /* _NO_RTTI */
protected:
 #endif /* _NO_RTTI */

	explicit type_info(const char *_Name)
		: _Myname(_Name)
		{	// construct with name
		}

	const char *_Myname;
  #endif /* __EDG__ etc. */

 #if _HAS_FUNCTION_DELETE
public:
	type_info(const type_info&) = delete;
	type_info& operator=(const type_info&) = delete;

 #else /* _HAS_FUNCTION_DELETE */
protected:	// to shut up compiler
	type_info(const type_info&);	// not defined

private:
	type_info& operator=(const type_info&);	// not defined
 #endif /* _HAS_FUNCTION_DELETE */
	};
}	/* namespace std */

 #if _HAS_NAMESPACE

 #else /* _HAS_NAMESPACE */
using _STD type_info;
 #endif /* _HAS_NAMESPACE */

 #endif /* defined(__BORLANDC__) && !__EDG__ */
#endif /* _TYPE_INFO_ */

/*
 * Copyright (c) by P.J. Plauger. All rights reserved.
 * Consult your license regarding permissions and restrictions.
V6.50:1422 */
